Component({
  properties: {
    bgColor: {
      type: String,
      value: '#f5f5f5'
    },
    list: {
      type: Array,
      value: []
    },
    urlKey: {
      type: String,
      value: 'url'
    },
    idKey: {
      type: String,
      value: ''
    }
  },
  data: {
    imgSrc: 'https://ja-material-formal.oss-cn-shenzhen.aliyuncs.com/Material/2022-03-04/25f4e17a14a248fdb133bc0fd7040dfd.jpg',
    indicatorDots: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    activeIndex: 0,
    videoSrc: 'https://ja-material-test.oss-cn-shenzhen.aliyuncs.com/Material/2022-05-13/656eed888a556c676c416a4d9d919908.mp4'
  },
  methods: {
    switchCard (e) {
      let current = e.detail.current
      this.setData({ activeIndex: current })
    },
    seeDetail ({ currentTarget: { dataset: { item } } }) {
      if (this.data.idKey === 'materialCaseId') {
        wx.$nav.navigateTo(`/pages/caseDetail/index?id=${item[this.data.idKey]}`)
      } else {
        wx.$nav.navigateTo(`/pages/materialDetail/index?id=${item.id}`)
      }
    }
  }
})